<template>
  <div>
    <div class="footer" @click="cliFooter"></div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },

  methods: {
    cliFooter() {
      //拿到当前可视区域的高度
      //   let a = document.documentElement.clientHeight;
      //   document.documentElement.scrollTop = a;
      //   console.log(document.documentElement.scrollTop);
      var clock = setInterval(function() {
        if (
          document.documentElement.scrollTop <
          document.documentElement.clientHeight
        ) {
          document.documentElement.scrollTop += 24;
        } else {
          clearInterval(clock);
        }
      }, 10);
    },
  },
};
</script>

<style lang="less" scoped>
.footer {
  position: absolute;
  left: 50%;
  bottom: 5%;
  transform: translateX(-50%);
  width: 0px;
  height: 0px;
  border-left: 60px solid transparent;
  border-top: 50px solid pink;
  border-right: 60px solid transparent;
  animation: rotate 3s linear infinite alternate;
  transition: 3s;
  cursor: pointer;
}
@keyframes rotate {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.2;
  }
}
</style>
